<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>修改员工信息</title>
</head>
<body>
<div>
    <form method="post" th:action="@{/emp}">
        <input type="hidden" name="_method" value="put">
        <input type="hidden" name="id" th:value="${#request.getAttribute('emp').id}">
        <table border="1" width="500">
            <tr>
                <th colspan="2">修改员工信息</th>
            </tr>
            <tr>
                <td>姓名：</td>
                <td><input type="text" th:value="${#request.getAttribute('emp').empName}" name="empName"></td>
            </tr>
            <tr>
                <td>年龄：</td>
                <td><input type="number" th:value="${#request.getAttribute('emp').empAge}" name="empAge"></td>
            </tr>
            <tr>
                <td>性别：</td>
                <td>
                    <span th:if="${#request.getAttribute('emp').empGender} == '男'">
                        男<input type="radio" checked value="男" name="empGender">
                        女<input type="radio" value="女" name="empGender">
                    </span>
                    <span th:unless="${#request.getAttribute('emp').empGender} == '男'">
                        男<input type="radio" value="男" name="empGender">
                        女<input type="radio" checked value="女" name="empGender">
                    </span>
                </td>
            </tr>
            <tr>
                <td>创建时间：</td>
                <td>
                    <span th:text="${#request.getAttribute('emp').createDate}"></span>
                </td>
            </tr>
            <tr>
                <td>部门编号：</td>
                <td>
                    <input type="number" th:value="${#request.getAttribute('emp').deptId}" name="deptId">
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <a th:href="@{/emp}">返回</a>
                    <input type="submit" value="保存">
                </td>
            </tr>
        </table>
    </form>
</div>
</body>
</html>